import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:study1/common/global.dart';

import 'package:study1/page/part_view/publis_gridview.dart';

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

   final String? _username=Global.cuser.nickname;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("我的主页"),
      ),
      body: Column(
        children: <Widget>[
          Row(
            children:  [
             Container(height: 20,width: ScreenUtil().setWidth(750),
             child:  Text(_username!),)
            ],
          ),
          Row(
            children: [
              Container(
                //效果
                decoration: BoxDecoration(
                    border: Border.all(), //边框
                    color: Colors.cyan, //背景色
                    // borderRadius: BorderRadius.circular(20) //圆角
                    ),
                height: 80,
                width: ScreenUtil().setWidth(750),
                padding: const EdgeInsets.all(3.0),
                child: const Text("测试"),
              ),
            ],
          ),
          Row(
            children: <Widget>[
              Container(
                padding: const EdgeInsets.only(left: 15, top: 15),
                height: ScreenUtil().setHeight(60),
                child: const Text(
                  "请选择要进行的操作",
                  style:
                      TextStyle(color: Colors.grey, fontSize: 18, height: 1.2),
                ),
              )
            ],
          ),
          Row(
            children: <Widget>[
              Container(
                color: Colors.orangeAccent,
                height: ScreenUtil().setHeight(600),
                width: MediaQuery.of(context).size.width,
                child: PublisGridView(),
              )
            ],
          ),
          SizedBox(
            height: 20,
          ),
        ],
      ),
    );
  }
}
